$(function(){

	var a4 = $("#hidA4").val();
	var province = a4.split("-")[0];
	var addr = $("#txtAddr").text();
	initMap(province,addr);  	
   	
	var vehicleId = window.location.href.split("&")[0].split("=")[1];
	$.ajax({
		type: "post",
		url: ctx + "/che.do?action=2&id=" + vehicleId
		
	});
	
	
});

function initMap(province,addr){
	// 百度地图API功能
	var map = new BMap.Map("baidu_map");
	var point = new BMap.Point(116.331398,39.897445);
	map.centerAndZoom(point,12);
	// 创建地址解析器实例
	var myGeo = new BMap.Geocoder();
	// 将地址解析结果显示在地图上,并调整地图视野
	myGeo.getPoint(addr, function(point){
	  if (point) {
	    map.centerAndZoom(point, 16);
	    map.addOverlay(new BMap.Marker(point));
	  }
	}, province);
}

$(window).load(function() { 
	$('.flexslider').flexslider({  
		 animation: "slide"
	});
});
   	